package org.java.mathgame.screens;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Screen;
import com.badlogic.gdx.graphics.GL10;
import com.badlogic.gdx.graphics.g2d.BitmapFont;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import org.java.mathgame.MathGame;


public class HowToPlayScreen implements Screen {
    private MathGame game;
    private SpriteBatch spriteBatch;
    private BitmapFont font;

    // constructor to keep a reference to the main Game class
    public HowToPlayScreen(MathGame game){
        this.game = game;
        spriteBatch = new SpriteBatch();
        font = new BitmapFont();
    }

    @Override
    public void render(float delta) {
        Gdx.gl.glClearColor(0.5f, 0.3f, 0.6f, 1);
        Gdx.gl.glClear(GL10.GL_COLOR_BUFFER_BIT);
        font.setColor(1f, 1f, 1f, 1f);
        spriteBatch.begin();
        font.draw(spriteBatch, "howToPlayScreen", Gdx.graphics.getHeight()/2, Gdx.graphics.getWidth()/2);
        spriteBatch.end();
        if (Gdx.input.justTouched()) // use your own criterion here
            game.setScreen(game.gameSettingsScreen);
    }


    @Override
    public void resize(int width, int height) {
    }


    @Override
    public void show() {
        // called when this screen is set as the screen with game.setScreen();
    }


    @Override
    public void hide() {
        // called when current screen changes from this to a different screen
    }


    @Override
    public void pause() {
    }


    @Override
    public void resume() {
    }


    @Override
    public void dispose() {
        // never called automatically
    }
}